#ifndef db_RECORDERRORSET_H
#define db_RECORDERRORSET_H

#include <algorithm>
#include <vector>
#include <string>

namespace serika
{
	namespace db
	{
		class RecordErrorSet
		{
		public:
			RecordErrorSet();
			~RecordErrorSet();
	
			void Add(const std::string& message);
			bool IsEmpty() const;
			void Clear();
			
			template<typename FN>
			void ForEach(FN fn);
	
			std::string JoinMessages(const std::string& splitter);
		private:
			std::vector<std::string> mMessages;
		};
	
		template<typename FN>
		void RecordErrorSet::ForEach(FN fn)
		{
			std::for_each(mMessages.begin(), mMessages.end(), fn);
		}
	}
}

#endif

